﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CanDoo.Data.Entity;
using CanDoo.Oil.Core.Models;

namespace CanDoo.Oil.Core.ModelConfigurations
{
    /// <summary>
    /// 实体类-数据表映射——其他入库单
    /// </summary>
    public class InStoreOtherConfiguration : EntityConfigurationBase<InStoreOther>
    {
        /// <summary>
        /// 初始化一个<see cref="InStoreOtherConfiguration"/>类型的新实例
        /// </summary>
        public InStoreOtherConfiguration()
        {
             ToTable("store_InStoreOther");
             this.Property(p => p.UserId).HasColumnName("UserId");
             this.HasRequired(p => p.User).WithMany().HasForeignKey(p => p.UserId).WillCascadeOnDelete(false);

             this.Property(p => p.GiveUserId).HasColumnName("GiveUserId");
             this.HasRequired(p => p.GiveUser).WithMany().HasForeignKey(p => p.GiveUserId).WillCascadeOnDelete(false);

             this.Property(p => p.NumId).HasColumnName("NumId");
             this.HasRequired(p => p.Num).WithMany().HasForeignKey(p => p.NumId).WillCascadeOnDelete(false);

        }
    }
}
